import urllib,urllib2,re,os

#author:
#elypter
#-mail:elypter@yahoo.de
#
#this is a prototype of a hoster-plugin for the iload.to xbmc plugin
#for details of the iload.to plugin look at default.py

#implementation:
#when a hosterlink is needed, first get_link1 is being called
#-if this hoster never requires captchas it should just return something like this ("plugin name", "hoster.com/movie/qwertzuiop123456","")
# important: img must be ""
# in this case get_link2 will never be called because it is only needed for captcha-handling
# ->in this situation the link is displayed directly and has the hoster-logo instead of a captcha
#-if this hoster (sometimes) requires captchas it should just return the same but with img containing the captcha-image-url
# important: -url1 doesnt have to be a valid url, indeed it is directly passed over to get_link2, so it can be used to hand over some data
#            -it sould only try to return an image only if a captcha is needed at the moment
# when the user enters the captcha get_link2 gets called
# ->if the video-link has been found get_link2 sould return it, then the user will be able to launch it
#   if "" is returned the user seed an error item
# -hint: xbmc doesnt recognise captchas with the ending .php or something else that is not an image extension
#        take a look @ filebase.py how it is handled there 

#integration:
#to add the plugin to default.py you have to insert code in 1 or 2 places depending on if the hoster uses captchas
#-in all cases you have to add:
# *in "def RELEASE(release):" @ "if name=="":" you have to add another elif entry
#-with usage of captchas:
# *in "def VERIFY(param):" @ "if hoster=="":" you have to add another elif entry
#-dont forget to add an import statement @ the beginning of default.py
#-if someone wants to make a plugin for megavideo: it is handled slightly different, take a look @ RELEASE() in default.py
#	>>>>CHANGE<<<< with the new site-layout it is hadled equally

def get_link1(url):
	#takes an videopage-url of filebase
	#
	#returnes the service/mirror name, the url that will be passed over to get_link2, the url of the verification code
	
	#if it is a hoster without a captcha
	return ("plugin prototype", url1, imageurl)
	
def get_link2(param,code):
	#should take the url that get_link1 returned
	#
	#returnes the video url
	
	#
	return url2